<template>
  <div>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          v-if="multiple"
          @click="handlerAdd"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="mini"
          v-if="!single"
          @click="handlerUpdate"
        >编辑
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="mini"
          v-if="!multiple"
          @click="handlerDelete"
        >移除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          icon="el-icon-download"
          size="mini"
          v-if="multiple"
          @click="handlerImport"
        >导入
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
          size="mini"
          v-if="multiple"
          @click="handlerExport"
        >导出
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
          size="mini"
          v-if="!multiple"
          @click="handlerSelectExport"
        >选择性导出
        </el-button>
      </el-col>
      <right-toolbar @queryTable="handlerList"></right-toolbar>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'TableTool',
  components: {},
  props: {
    multiple: {
      type: Boolean,
      default: false
    },
    single: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {}
  },
  // 在实例创建完成后被立即调用
  created() {

  },
  // 实例被挂在后调用
  mounted() {

  },
  // 方法
  methods: {
    handlerAdd() {
      this.$emit('add')
    },
    handlerDelete() {
      this.$emit('delete')
    },
    handlerImport() {
      this.$emit('import')
    },
    handlerUpdate() {
      this.$emit('update')
    },
    handlerExport() {
      this.$emit('export')
    },
    handlerSelectExport() {
      this.$emit('select-export')
    },
    handlerList() {
      this.$emit('list')
    }
  }
}
</script>

<style scoped>

</style>
